package com.flightgame.tools;

import com.flightgame.hibernate.Airport;
import com.flightgame.hibernate.Flight;
import com.flightgame.hibernate.Ownership;

public class Builder {
	public Ownership ownershipBuilder(String username,String itemname,double lat,double lon,String airportCode,String params){
		Ownership ownership = new Ownership();
		ownership.setUsername(username);
		ownership.setItemname(itemname);
		ownership.setLat(lat);
		ownership.setLon(lon);
		ownership.setAirportcode(airportCode);
		ownership.setParams(params);
		
		return ownership;
	}
	
	public Flight flightBuilder(String username,String itemname,double lat,double lon,double alt,int ownershipId){
		Flight flight = new Flight();
		
		flight.setUserName(username);
		flight.setAircraftName(itemname);
		flight.setLat(lat);
		flight.setLon(lon);
		flight.setAltitude(0);
		flight.setOwnershipId(ownershipId);
		
		return flight;
	}
	
	public Airport airportBuilder(String airportName,String airportCode,double lat,double lon){
		Airport airport= new Airport();
		
		airport.setAirportName(airportName);
		airport.setAirportCode(airportCode);
		airport.setLat(lat);
		airport.setLon(lon);
		
		return airport;
	}
}
